package Month09.day0917;

import Month09.day0916_2.B;

import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int[] a = new int[]{5,4,3,2,1,6,8};
        Bubble(a);
        System.out.println( Arrays.toString(a));
    }

    public static void Bubble(int[] a){
        for (int i = a.length - 1; i > 0; i--) {
            for (int j = 0; j < i; j++) {
                if(a[j] > a[j + 1]){
                    int tmp = a[j];
                    a[j] =  a[j + 1];
                    a[j + 1] = tmp;
                }
            }
        }
    }
}
